﻿<div class="row">
    <div class="col-md-9">
        <div class="panel panel-default" id="CreditSale_List">


            @{Html.RenderAction("CreditSaleTD_List", "SaleCredit");}


        </div>
        
            <button type="button" class="btn btn-success pull-right" onclick="Checkout()">结账</button>      
    </div>
    <div class="col-md-3">


        <div id="playersDiv"></div>
        <div id="">转移：@{Html.RenderAction("CreditSaleSetup", "UserCtrl");}</div>
    </div>
</div>
<script type="text/javascript">

    $("#playersDiv").load("Sale/SaleGoods");
    //这个页面禁止后退，以刷新主页面的挂账参数
    jQuery(document).ready(function () {
        if (window.history && window.history.pushState) {
            $(window).on('popstate', function () {
                /// 当点击浏览器的 后退和前进按钮 时才会被触发， 
                window.history.pushState('forward', null, '');
                window.history.forward(1);
            });
        }
        //
        window.history.pushState('forward', null, '');  //在IE中必须得有这两行
        window.history.forward(1);
    });
</script>
<script type="text/javascript">
    function Checkout()
    {
        var Request = new Object();
        Request = GetRequest(this.location.href);
        CreditSaleNOID = Request['CreditSaleNOID'].split("#")[0];
        alert(CreditSaleNOID);
        $.ajax({
            type: "POST",
            url: "SaleCredit/CreditSaleTD_List_Checkout",
            data: "CreditSaleNOID="+CreditSaleNOID,
            success: function (msg) {
                alert("Data Saved: " + msg);
            }
        });
    }
</script>